fix(router): 7 bugs in @ruvector/router — broken wrapper, score inversion, DB crashes#333
Merged
fix(router): 7 bugs in @ruvector/router — broken wrapper, score inversion, DB crashes#333
Conversation
Fixes #332 Critical: - router-wrapper.ts: `dimensions` → `dimension` (constructor always threw) - router-wrapper.ts: align with actual SemanticRouter API (addIntent, route, routeWithEmbedding, removeIntent) High: - index.js: convert native distance scores to similarity (0→1 scale) - storage.rs: handle TableDoesNotExist on fresh DB reads - lib.rs (FFI): unique temp DB path per instance (no lock conflicts) Medium: - index.js: addIntentAsync throws on missing embedder+embedding - index.js: load() validates dimension mismatch - package.json: align all platform deps to 0.1.28 CI: - build-router.yml: --cargo-cwd → --manifest-path for newer napi-rs Co-Authored-By: claude-flow <ruv@ruv.net>
The CI devDependency @napi-rs/cli ^2.18.0 uses --cargo-cwd. --manifest-path is v3.x only. Co-Authored-By: claude-flow <ruv@ruv.net>
ruvnet
added a commit
that referenced
this pull request
Apr 6, 2026
The router-wrapper was already fixed in #333 but the ruvector package version wasn't bumped for npm publish. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #332 — 7 bugs in
@ruvector/routerthat made SemanticRouter completely non-functional through the wrapper and partially broken when used directly.dimensionsvsdimension) — constructor always threwaddRoute,match,matchTopK,removeRoute)count()/get()— redb tables don't exist until first write./vectors.dbfile lockaddIntentAsyncsilently dropped intents without embedder or embeddingFiles Changed
router-wrapper.ts/js/d.tssetEmbedder/matchWithEmbeddingrouter/index.jsstorage.rsTableDoesNotExistin all read methodslib.rspackage.json×60.1.28build-router.yml--cargo-cwd→--manifest-pathTest plan
node npm/packages/router/test.js— all checks pass locally (darwin-arm64)npm install @ruvector/routerresolves correct platform binaryTest Results (local)
🤖 Generated with claude-flow